class Student():
    #类属性创建
    school="北京教育"
    #实例属性
    def __init__(self, name, age):
        self.name = name
        self.age = age
    #实例方法
    def show(self):
        print(f'我叫:{self.name}.今年:{self.age}岁了')
    #类方法
    @classmethod
    def show2(cls):
        print("类方法")
xs1 = Student('dxl',20)
xs2 = Student('cmm',22)
print(xs1.name, xs1.age, xs2.name, xs2.age)

#为stu2动态绑定实例属性
xs2.gender='男'
print(xs2.gender,xs2.age,xs2.name)


##动态方法绑定
def introduce():
    print('我是普通函数，我被su2绑定成了动态实例方法')
xs2.fun=introduce
#调用
xs2.fun()





















